#ifndef __QOS_AGENT_HH__
#define __QOS_AGENT_HH__

#include <iostream>
#include <sstream>
#include <string>
#include <vector>

#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/protocol/MessageBuffer.hh"

#include "mem/ruby/network/Network.hh"
#include "mem/ruby/network/simple/Switch.hh"

class QOS_Agent : public Consumer
{

public:
    QOS_Agent(Network*, Switch*);
    
    void wakeup();

    void print(std::ostream&) const;

    void addInPort(const std::vector<MessageBuffer*>& in);
    void addOutPort(const std::vector<MessageBuffer*>& out);

private:
    std::vector<MessageBuffer*> m_in;
    std::vector<MessageBuffer*> m_out;

    int m_credits;
    int m_packets_per_tick;
    int m_credits_replenish;
    int m_credits_max;

    int m_virtual_networks;
    Network* m_net_ptr;
    Switch* m_switch_ptr;
};

#endif // __QOS_AGENT__
